import QtQuick 2.0

Item {
    id:loginButton
    property int buttonWidth: 120
    property int buttonHeight: 35
    property int buttonRadius:5
    property string buttonDefault:"#000000"
    property bool buttonHover:true
    property string buttonBorderColor:"#cccccc"
    property string buttonHoverColor:"blue"
    property string buttonClickColor:"#098CBC"

    signal buttonClick();

    Rectangle{
        id:logonPushButton
        width: buttonWidth
        height: buttonHeight
        radius: buttonRadius
        color:buttonDefault
        border.color: buttonBorderColor



        MouseArea{
            id:ma
            anchors.fill: parent
            hoverEnabled: true
            onClicked: {

                buttonClick();


            }
            onPressed: {
                colorAnimationClick.start();
            }
            onReleased:{
                 colorAnimationStart.start();
            }
            onEntered: {
                colorAnimationStart.start();

            }
            onExited: {
                colorAnimationStart.stop();
                colorAnimationEnd.start();

            }
        }

    }

    ColorAnimation{
            id:colorAnimationStart
            target: logonPushButton
            property: "color"
            to: buttonHoverColor
            duration: 200
    }
    ColorAnimation{
            id:colorAnimationEnd
            target: logonPushButton
            property: "color"
            to: buttonDefault
            duration: 200
    }
    ColorAnimation{
            id:colorAnimationClick
            target: logonPushButton
            property: "color"
            to: buttonClickColor
            duration: 200
    }
}
